home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_emacs.idb / usr / freeware / info / emacs-15.z / emacs-15
Encoding:
GNU Info File  |  1998-10-28  |  48.8 KB  |  1,141 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.63 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Dabbrev Customization,  Prev: Dynamic Abbrevs,  Up: Abbrevs
  6.  
  7. Customizing Dynamic Abbreviation
  8. ================================
  9.  
  10.    Normally, dynamic abbrev expansion ignores case when searching for
  11. expansions.  That is, the expansion need not agree in case with the word
  12. you are expanding.  If you set `dabbrev-case-fold-search' to `nil',
  13. then the word and the expansion must match in case.
  14.  
  15.    The value of `dabbrev-case-fold-search' may be any expression.
  16. Dynamic abbrev expansion evaluates that expression, and ignores case
  17. while searching if its value is not `nil'.  The default value of
  18. `dabbrev-case-fold-search' is `case-fold-search', so normally the value
  19. of `case-fold-search' controls the decision.  The reason why dynamic
  20. abbrev expansion normally ignores case when searching for expansions is
  21. that normally the value of `case-fold-search' is `t'.
  22.  
  23.    Normally, dynamic abbrev expansion preserves the case pattern *of
  24. the word you are expanding*, by converting the expansion to that case
  25. pattern.  If you set `dabbrev-case-replace' to `nil', the expansion is
  26. copied without conversion.
  27.  
  28.    The variables `dabbrev-case-fold-search' and `dabbrev-case-replace'
  29. are handled in a special way.  Their values are actually Lisp
  30. expressions which are evaluated each time a decision needs to be made.
  31. If the expression's value is non-`nil', then case is ignored in
  32. searching, or converted on replacement, respectively.  If the
  33. expression's value is `nil', case is not ignored or not converted.  The
  34. default values let the variables `case-fold-search' (*note Search
  35. Case::.) and `case-replace' (*note Replacement and Case::.) control
  36. what to do.
  37.  
  38.    The variable `dabbrev-abbrev-char-regexp', if non-`nil', controls
  39. which characters are considered part of a word, for dynamic expansion
  40. purposes.  The regular expression must match just one character, never
  41. two or more.  The same regular expression also determines which
  42. characters are part of an expansion.  The value `nil' has a special
  43. meaning: abbreviations are made of word characters, but expansions are
  44. made of word and symbol characters.
  45.  
  46.    In shell scripts and makefiles, a variable name is sometimes prefixed
  47. with `$' and sometimes not.  Major modes for this kind of text can
  48. customize dynamic abbreviation to handle optional prefixes by setting
  49. the variable `dabbrev-abbrev-skip-leading-regexp'.  Its value should be
  50. a regular expression that matches the optional prefix that dynamic
  51. abbreviation should ignore.
  52.  
  53. 
  54. File: emacs,  Node: Picture,  Next: Sending Mail,  Prev: Abbrevs,  Up: Top
  55.  
  56. Editing Pictures
  57. ****************
  58.  
  59.    To edit a picture made out of text characters (for example, a picture
  60. of the division of a register into fields, as a comment in a program),
  61. use the command `M-x edit-picture' to enter Picture mode.
  62.  
  63.    In Picture mode, editing is based on the "quarter-plane" model of
  64. text, according to which the text characters lie studded on an area that
  65. stretches infinitely far to the right and downward.  The concept of the
  66. end of a line does not exist in this model; the most you can say is
  67. where the last nonblank character on the line is found.
  68.  
  69.    Of course, Emacs really always considers text as a sequence of
  70. characters, and lines really do have ends.  But Picture mode replaces
  71. the most frequently-used commands with variants that simulate the
  72. quarter-plane model of text.  They do this by inserting spaces or by
  73. converting tabs to spaces.
  74.  
  75.    Most of the basic editing commands of Emacs are redefined by Picture
  76. mode to do essentially the same thing but in a quarter-plane way.  In
  77. addition, Picture mode defines various keys starting with the `C-c'
  78. prefix to run special picture editing commands.
  79.  
  80.    One of these keys, `C-c C-c', is pretty important.  Often a picture
  81. is part of a larger file that is usually edited in some other major
  82. mode.  `M-x edit-picture' records the name of the previous major mode
  83. so you can use the `C-c C-c' command (`picture-mode-exit') later to go
  84. back to that mode.  `C-c C-c' also deletes spaces from the ends of
  85. lines, unless given a numeric argument.
  86.  
  87.    The special commands of Picture mode all work in other modes
  88. (provided the `picture' library is loaded), but are not bound to keys
  89. except in Picture mode.  The descriptions below talk of moving "one
  90. column" and so on, but all the picture mode commands handle numeric
  91. arguments as their normal equivalents do.
  92.  
  93.    Turning on Picture mode runs the hook `picture-mode-hook' (*note
  94. Hooks::.).
  95.  
  96. * Menu:
  97.  
  98. * Basic Picture::         Basic concepts and simple commands of Picture Mode.
  99. * Insert in Picture::     Controlling direction of cursor motion
  100.                             after "self-inserting" characters.
  101. * Tabs in Picture::       Various features for tab stops and indentation.
  102. * Rectangles in Picture:: Clearing and superimposing rectangles.
  103.  
  104. 
  105. File: emacs,  Node: Basic Picture,  Next: Insert in Picture,  Prev: Picture,  Up: Picture
  106.  
  107. Basic Editing in Picture Mode
  108. =============================
  109.  
  110.    Most keys do the same thing in Picture mode that they usually do, but
  111. do it in a quarter-plane style.  For example, `C-f' is rebound to run
  112. `picture-forward-column', a command which moves point one column to the
  113. right, inserting a space if necessary so that the actual end of the
  114. line makes no difference.  `C-b' is rebound to run
  115. `picture-backward-column', which always moves point left one column,
  116. converting a tab to multiple spaces if necessary.  `C-n' and `C-p' are
  117. rebound to run `picture-move-down' and `picture-move-up', which can
  118. either insert spaces or convert tabs as necessary to make sure that
  119. point stays in exactly the same column.  `C-e' runs
  120. `picture-end-of-line', which moves to after the last nonblank character
  121. on the line.  There is no need to change `C-a', as the choice of screen
  122. model does not affect beginnings of lines.
  123.  
  124.    Insertion of text is adapted to the quarter-plane screen model
  125. through the use of Overwrite mode (*note Minor Modes::.).
  126. Self-inserting characters replace existing text, column by column,
  127. rather than pushing existing text to the right.  RET runs
  128. `picture-newline', which just moves to the beginning of the following
  129. line so that new text will replace that line.
  130.  
  131.    Picture mode provides erasure instead of deletion and killing of
  132. text.  DEL (`picture-backward-clear-column') replaces the preceding
  133. character with a space rather than removing it; this moves point
  134. backwards.  `C-d' (`picture-clear-column') replaces the next character
  135. or characters with spaces, but does not move point.  (If you want to
  136. clear characters to spaces and move forward over them, use SPC.)  `C-k'
  137. (`picture-clear-line') really kills the contents of lines, but does not
  138. delete the newlines from the buffer.
  139.  
  140.    To do actual insertion, you must use special commands.  `C-o'
  141. (`picture-open-line') creates a blank line after the current line; it
  142. never splits a line.  `C-M-o', `split-line', makes sense in Picture
  143. mode, so it is not changed.  LFD (`picture-duplicate-line') inserts
  144. below the current line another line with the same contents.
  145.  
  146.    To do actual deletion in Picture mode, use `C-w', `C-c C-d' (which
  147. is defined as `delete-char', as `C-d' is in other modes), or one of the
  148. picture rectangle commands (*note Rectangles in Picture::.).
  149.  
  150. 
  151. File: emacs,  Node: Insert in Picture,  Next: Tabs in Picture,  Prev: Basic Picture,  Up: Picture
  152.  
  153. Controlling Motion after Insert
  154. ===============================
  155.  
  156.    Since "self-inserting" characters in Picture mode overwrite and move
  157. point, there is no essential restriction on how point should be moved.
  158. Normally point moves right, but you can specify any of the eight
  159. orthogonal or diagonal directions for motion after a "self-inserting"
  160. character.  This is useful for drawing lines in the buffer.
  161.  
  162. `C-c <'
  163.      Move left after insertion (`picture-movement-left').
  164.  
  165. `C-c >'
  166.      Move right after insertion (`picture-movement-right').
  167.  
  168. `C-c ^'
  169.      Move up after insertion (`picture-movement-up').
  170.  
  171. `C-c .'
  172.      Move down after insertion (`picture-movement-down').
  173.  
  174. `C-c `'
  175.      Move up and left ("northwest") after insertion
  176.      (`picture-movement-nw').
  177.  
  178. `C-c ''
  179.      Move up and right ("northeast") after insertion
  180.      (`picture-movement-ne').
  181.  
  182. `C-c /'
  183.      Move down and left ("southwest") after insertion
  184.      (`picture-movement-sw').
  185.  
  186. `C-c \'
  187.      Move down and right ("southeast") after insertion
  188.      (`picture-movement-se').
  189.  
  190.    Two motion commands move based on the current Picture insertion
  191. direction.  The command `C-c C-f' (`picture-motion') moves in the same
  192. direction as motion after "insertion" currently does, while `C-c C-b'
  193. (`picture-motion-reverse') moves in the opposite direction.
  194.  
  195. 
  196. File: emacs,  Node: Tabs in Picture,  Next: Rectangles in Picture,  Prev: Insert in Picture,  Up: Picture
  197.  
  198. Picture Mode Tabs
  199. =================
  200.  
  201.    Two kinds of tab-like action are provided in Picture mode.  Use
  202. `M-TAB' (`picture-tab-search') for context-based tabbing.  With no
  203. argument, it moves to a point underneath the next "interesting"
  204. character that follows whitespace in the previous nonblank line.
  205. "Next" here means "appearing at a horizontal position greater than the
  206. one point starts out at."  With an argument, as in `C-u M-TAB', this
  207. command moves to the next such interesting character in the current
  208. line.  `M-TAB' does not change the text; it only moves point.
  209. "Interesting" characters are defined by the variable
  210. `picture-tab-chars', which should define a set of characters.  The
  211. syntax for this variable is like the syntax used inside of `[...]' in a
  212. regular expression--but without the `[' and the `]'.  Its default value
  213. is `"!-~"'.
  214.  
  215.    TAB itself runs `picture-tab', which operates based on the current
  216. tab stop settings; it is the Picture mode equivalent of
  217. `tab-to-tab-stop'.  Normally it just moves point, but with a numeric
  218. argument it clears the text that it moves over.
  219.  
  220.    The context-based and tab-stop-based forms of tabbing are brought
  221. together by the command `C-c TAB', `picture-set-tab-stops'.  This
  222. command sets the tab stops to the positions which `M-TAB' would
  223. consider significant in the current line.  The use of this command,
  224. together with TAB, can get the effect of context-based tabbing.  But
  225. `M-TAB' is more convenient in the cases where it is sufficient.
  226.  
  227.    It may be convenient to prevent use of actual tab characters in
  228. pictures.  For example, this prevents `C-x TAB' from messing up the
  229. picture.  You can do this by setting the variable `indent-tabs-mode' to
  230. `nil'.  *Note Just Spaces::.
  231.  
  232. 
  233. File: emacs,  Node: Rectangles in Picture,  Prev: Tabs in Picture,  Up: Picture
  234.  
  235. Picture Mode Rectangle Commands
  236. ===============================
  237.  
  238.    Picture mode defines commands for working on rectangular pieces of
  239. the text in ways that fit with the quarter-plane model.  The standard
  240. rectangle commands may also be useful (*note Rectangles::.).
  241.  
  242. `C-c C-k'
  243.      Clear out the region-rectangle with spaces
  244.      (`picture-clear-rectangle').  With argument, delete the text.
  245.  
  246. `C-c C-w R'
  247.      Similar but save rectangle contents in register R first
  248.      (`picture-clear-rectangle-to-register').
  249.  
  250. `C-c C-y'
  251.      Copy last killed rectangle into the buffer by overwriting, with
  252.      upper left corner at point (`picture-yank-rectangle').  With
  253.      argument, insert instead.
  254.  
  255. `C-c C-x R'
  256.      Similar, but use the rectangle in register R
  257.      (`picture-yank-rectangle-from-register').
  258.  
  259.    The picture rectangle commands `C-c C-k' (`picture-clear-rectangle')
  260. and `C-c C-w' (`picture-clear-rectangle-to-register') differ from the
  261. standard rectangle commands in that they normally clear the rectangle
  262. instead of deleting it; this is analogous with the way `C-d' is changed
  263. in Picture mode.
  264.  
  265.    However, deletion of rectangles can be useful in Picture mode, so
  266. these commands delete the rectangle if given a numeric argument.  `C-c
  267. C-k' either with or without a numeric argument saves the rectangle for
  268. `C-c C-y'.
  269.  
  270.    The Picture mode commands for yanking rectangles differ from the
  271. standard ones in overwriting instead of inserting.  This is the same way
  272. that Picture mode insertion of other text differs from other modes.
  273. `C-c C-y' (`picture-yank-rectangle') inserts (by overwriting) the
  274. rectangle that was most recently killed, while `C-c C-x'
  275. (`picture-yank-rectangle-from-register') does likewise for the
  276. rectangle found in a specified register.
  277.  
  278. 
  279. File: emacs,  Node: Sending Mail,  Next: Rmail,  Prev: Picture,  Up: Top
  280.  
  281. Sending Mail
  282. ************
  283.  
  284.    To send a message in Emacs, you start by typing a command (`C-x m')
  285. to select and initialize the `*mail*' buffer.  Then you edit the text
  286. and headers of the message in this buffer, and type another command
  287. (`C-c C-s' or `C-c C-c') to send the message.
  288.  
  289. `C-x m'
  290.      Begin composing a message to send (`mail').
  291.  
  292. `C-x 4 m'
  293.      Likewise, but display the message in another window
  294.      (`mail-other-window').
  295.  
  296. `C-x 5 m'
  297.      Likewise, but make a new frame (`mail-other-frame').
  298.  
  299. `C-c C-s'
  300.      In Mail mode, send the message (`mail-send').
  301.  
  302. `C-c C-c'
  303.      Send the message and bury the mail buffer (`mail-send-and-exit').
  304.  
  305.    The command `C-x m' (`mail') selects a buffer named `*mail*' and
  306. initializes it with the skeleton of an outgoing message.  `C-x 4 m'
  307. (`mail-other-window') selects the `*mail*' buffer in a different
  308. window, leaving the previous current buffer visible.  `C-x 5 m'
  309. (`mail-other-frame') creates a new frame to select the `*mail*' buffer.
  310.  
  311.    Because the mail composition buffer is an ordinary Emacs buffer, you
  312. can switch to other buffers while in the middle of composing mail, and
  313. switch back later (or never).  If you use the `C-x m' command again
  314. when you have been composing another message but have not sent it, you
  315. are asked to confirm before the old message is erased.  If you answer
  316. `n', the `*mail*' buffer is left selected with its old contents, so you
  317. can finish the old message and send it.  `C-u C-x m' is another way to
  318. do this.  Sending the message marks the `*mail*' buffer "unmodified",
  319. which avoids the need for confirmation when `C-x m' is next used.
  320.  
  321.    If you are composing a message in the `*mail*' buffer and want to
  322. send another message before finishing the first, rename the `*mail*'
  323. buffer using `M-x rename-uniquely' (*note Misc Buffer::.).  Then you
  324. can use `C-x m' or its variants described above to make a new `*mail*'
  325. buffer.  Once you've done that, you can work with each mail buffer
  326. independently.
  327.  
  328. * Menu:
  329.  
  330. * Format: Mail Format.         Format of the mail being composed.
  331. * Headers: Mail Headers.     Details of permitted mail header fields.
  332. * Aliases: Mail Aliases.     Abbreviating and grouping mail addresses.
  333. * Mode: Mail Mode.         Special commands for editing mail being composed.
  334. * Spook: Distracting NSA.    How to distract the NSA's attention.
  335.  
  336. 
  337. File: emacs,  Node: Mail Format,  Next: Mail Headers,  Up: Sending Mail
  338.  
  339. The Format of the Mail Buffer
  340. =============================
  341.  
  342.    In addition to the "text" or "body", a message has "header fields"
  343. which say who sent it, when, to whom, why, and so on.  Some header
  344. fields such as the date and sender are created automatically after the
  345. message is sent.  Others, such as the recipient names, must be
  346. specified by you in order to send the message properly.
  347.  
  348.    Mail mode provides a few commands to help you edit some header
  349. fields, and some are preinitialized in the buffer automatically at
  350. times.  You can insert and edit header fields using ordinary editing
  351. commands.
  352.  
  353.    The line in the buffer that says
  354.  
  355.      --text follows this line--
  356.  
  357. is a special delimiter that separates the headers you have specified
  358. from the text.  Whatever follows this line is the text of the message;
  359. the headers precede it.  The delimiter line itself does not appear in
  360. the message actually sent.  The text used for the delimiter line is
  361. controlled by the variable `mail-header-separator'.
  362.  
  363.    Here is an example of what the headers and text in the mail buffer
  364. might look like.
  365.  
  366.      To: gnu@prep.ai.mit.edu
  367.      CC: lungfish@spam.org, byob@spam.org
  368.      Subject: The Emacs Manual
  369.      --Text follows this line--
  370.      Please ignore this message.
  371.  
  372. 
  373. File: emacs,  Node: Mail Headers,  Next: Mail Aliases,  Prev: Mail Format,  Up: Sending Mail
  374.  
  375. Mail Header Fields
  376. ==================
  377.  
  378.    A header field in the mail buffer starts with a field name at the
  379. beginning of a line, terminated by a colon.  Upper and lower case are
  380. equivalent in field names (and in mailing addresses also).  After the
  381. colon and optional whitespace comes the contents of the field.
  382.  
  383.    You can use any name you like for a header field, but normally people
  384. use only standard field names with accepted meanings.  Here is a table
  385. of fields commonly used in outgoing messages.
  386.  
  387. `To'
  388.      This field contains the mailing addresses to which the message is
  389.      addressed.
  390.  
  391. `Subject'
  392.      The contents of the `Subject' field should be a piece of text that
  393.      says what the message is about.  The reason `Subject' fields are
  394.      useful is that most mail-reading programs can provide a summary of
  395.      messages, listing the subject of each message but not its text.
  396.  
  397. `CC'
  398.      This field contains additional mailing addresses to send the
  399.      message to, but whose readers should not regard the message as
  400.      addressed to them.
  401.  
  402. `BCC'
  403.      This field contains additional mailing addresses to send the
  404.      message to, which should not appear in the header of the message
  405.      actually sent.  Copies sent this way are called "blind carbon
  406.      copies".
  407.  
  408.      To send a blind carbon copy of every outgoing message to yourself,
  409.      set the variable `mail-self-blind' to `t'.
  410.  
  411. `FCC'
  412.      This field contains the name of one file and directs Emacs to
  413.      append a copy of the message to that file when you send the
  414.      message.  If the file is in Rmail format, Emacs writes the message
  415.      to Rmail format; otherwise, Emacs writes the message in system
  416.      mail file format.
  417.  
  418.      To put a fixed file name as in `FCC' field each time you start
  419.      editing an outgoing message, set the variable
  420.      `mail-archive-file-name' to that file name.  Unless you remove the
  421.      `FCC' field before sending, the message will be written into that
  422.      file when it is sent.
  423.  
  424. `From'
  425.      Use the `From' field to say who you are, when the account you are
  426.      using to send the mail is not your own.  The contents of the `From'
  427.      field should be a valid mailing address, since replies will
  428.      normally go there.  If you don't specify the `From' field
  429.      yourself, Emacs uses the value of `user-mail-address' as the
  430.      default.
  431.  
  432. `Reply-to'
  433.      Use this field to direct replies to a different address.  Most
  434.      mail-reading programs (including Rmail) automatically send replies
  435.      to the `Reply-to' address in preference to the `From' address.  By
  436.      adding a `Reply-to' field to your header, you can work around any
  437.      problems your `From' address may cause for replies.
  438.  
  439.      To put a fixed `Reply-to' address into every outgoing message, set
  440.      the variable `mail-default-reply-to' to that address (as a string).
  441.      Then `mail' initializes the message with a `Reply-to' field as
  442.      specified.  You can delete or alter that header field before you
  443.      send the message, if you wish.  When Emacs starts up, if the
  444.      environment variable `REPLYTO' is set, `mail-default-reply-to' is
  445.      initialized from that environment variable.
  446.  
  447. `In-reply-to'
  448.      This field contains a piece of text describing a message you are
  449.      replying to.  Some mail systems can use this information to
  450.      correlate related pieces of mail.  Normally this field is filled
  451.      in by Rmail when you reply to a message in Rmail, and you never
  452.      need to think about it (*note Rmail::.).
  453.  
  454.    The `To', `CC', `BCC' and `FCC' fields can appear any number of
  455. times, to specify many places to send the message.  The `To', `CC', and
  456. `BCC' fields can have continuation lines.  All the lines starting with
  457. whitespace, following the line on which the field starts, are
  458. considered part of the field.  For example,
  459.  
  460.      To: foo@here.net, this@there.net,
  461.        me@gnu.cambridge.mass.usa.earth.spiral3281
  462.  
  463.    When you send the message, if you didn't write a `From' field
  464. yourself, Emacs puts in one for you.  The variable `mail-from-style'
  465. controls the format:
  466.  
  467. `nil'
  468.      Just the email address, as in `king@grassland.com'.
  469.  
  470. `parens'
  471.      Both email address and full name, as in `king@grassland.com (Elvis
  472.      Parsley)'.
  473.  
  474. `angles'
  475.      Both email address and full name, as in `Elvis Parsley
  476.      <king@grassland.com>'.
  477.  
  478. 
  479. File: emacs,  Node: Mail Aliases,  Next: Mail Mode,  Prev: Mail Headers,  Up: Sending Mail
  480.  
  481. Mail Aliases
  482. ============
  483.  
  484.    You can define "mail aliases" in a file named `~/.mailrc'.  These
  485. are short mnemonic names which stand for mail addresses or groups of
  486. mail addresses.  Like many other mail programs, Emacs expands aliases
  487. when they occur in the `To', `From', `CC', `BCC', and `Reply-to'
  488. fields, plus their `Resent-' variants.
  489.  
  490.    To define an alias in `~/.mailrc', write a line in the following
  491. format:
  492.  
  493.      alias SHORTADDRESS FULLADDRESSES
  494.  
  495. Here FULLADDRESSES stands for one or more mail addresses for
  496. SHORTADDRESS to expand into.  Separate multiple addresses with spaces;
  497. if an address contains a space, quote the whole address with a pair of
  498. double-quotes.
  499.  
  500.    For instance, to make `maingnu' stand for `gnu@prep.ai.mit.edu' plus
  501. a local address of your own, put in this line:
  502.  
  503.      alias maingnu gnu@prep.ai.mit.edu local-gnu
  504.  
  505.    Emacs also recognizes include commands in `.mailrc' files.  They
  506. look like this:
  507.  
  508.      source FILENAME
  509.  
  510. The file `~/.mailrc' is used primarily by other mail-reading programs;
  511. it can contain various other commands.  Emacs ignores everything in it
  512. except for alias definitions and include commands.
  513.  
  514.    Another way to define a mail alias, within Emacs alone, is with the
  515. `define-mail-alias' command.  It prompts for the alias and then the
  516. full address.  You can use it to define aliases in your `.emacs' file,
  517. like this:
  518.  
  519.      (define-mail-alias "maingnu" "gnu@prep.ai.mit.edu")
  520.  
  521.    `define-mail-alias' records aliases by adding them to a variable
  522. named `mail-aliases'.  If you are comfortable with manipulating Lisp
  523. lists, you can set `mail-aliases' directly.  The initial value of
  524. `mail-aliases' is `t', which means that Emacs should read `.mailrc' to
  525. get the proper value.
  526.  
  527.    You can specify a different file name to use instead of `~/.mailrc'
  528. by setting the variable `mail-personal-alias-file'.
  529.  
  530.    Normally, Emacs expands aliases when you send the message.  If you
  531. like, you can have mail aliases expand as abbrevs, as soon as you type
  532. them in (*note Abbrevs::.).  To enable this feature, execute the
  533. following:
  534.  
  535.      (add-hook 'mail-setup-hook 'mail-abbrevs-setup)
  536.  
  537. This can go in your `.emacs' file.  *Note Hooks::.  If you use this
  538. feature, you must use `define-mail-abbrev' instead of
  539. `define-mail-alias'; the latter does not work with this package.  Note
  540. that the mail abbreviation package uses the variable `mail-abbrevs'
  541. instead of `mail-aliases', and that all alias names are converted to
  542. lower case.
  543.  
  544.    The mail abbreviation package also provides the `C-c C-a'
  545. (`mail-interactive-insert-alias') command, which reads an alias name
  546. (with completion) and inserts its definition at point.  This is useful
  547. when editing the message text itself or a header field such as
  548. `Subject' in which Emacs does not normally expand aliases.
  549.  
  550.    Note that abbrevs expand only if you insert a word-separator
  551. character afterward.  However, you can rebind `C-n' and `M->' to cause
  552. expansion as well.  Here's how to do that:
  553.  
  554.      (add-hook 'mail-setup-hook
  555.                '(lambda ()
  556.                   (substitute-key-definition
  557.                     'next-line 'mail-abbrev-next-line
  558.                     mail-mode-map global-map)
  559.                   (substitute-key-definition
  560.                     'end-of-buffer 'mail-abbrev-end-of-buffer
  561.                     mail-mode-map global-map)))
  562.  
  563. 
  564. File: emacs,  Node: Mail Mode,  Next: Distracting NSA,  Prev: Mail Aliases,  Up: Sending Mail
  565.  
  566. Mail Mode
  567. =========
  568.  
  569.    The major mode used in the mail buffer is Mail mode, which is much
  570. like Text mode except that various special commands are provided on the
  571. `C-c' prefix.  These commands all have to do specifically with editing
  572. or sending the message.
  573.  
  574. `C-c C-s'
  575.      Send the message, and leave the mail buffer selected (`mail-send').
  576.  
  577. `C-c C-c'
  578.      Send the message, and select some other buffer
  579.      (`mail-send-and-exit').
  580.  
  581. `M-TAB'
  582.      Complete a mailing address (`mail-complete').
  583.  
  584. `C-c C-f C-t'
  585.      Move to the `To' header field, creating one if there is none
  586.      (`mail-to').
  587.  
  588. `C-c C-f C-s'
  589.      Move to the `Subject' header field, creating one if there is none
  590.      (`mail-subject').
  591.  
  592. `C-c C-f C-c'
  593.      Move to the `CC' header field, creating one if there is none
  594.      (`mail-cc').
  595.  
  596. `C-c C-f C-b'
  597.      Move to the `BCC' header field, creating one if there is none
  598.      (`mail-bcc').
  599.  
  600. `C-c C-f C-f'
  601.      Move to the `FCC' header field, creating one if there is none
  602.      (`mail-fcc').
  603.  
  604. `C-c C-t'
  605.      Move to the beginning of the message body text (`mail-text').
  606.  
  607. `C-c C-w'
  608.      Insert the file `~/.signature' at the end of the message text
  609.      (`mail-signature').
  610.  
  611. `C-c C-y'
  612.      Yank the selected message from Rmail (`mail-yank-original').  This
  613.      command does nothing unless your command to start sending a
  614.      message was issued with Rmail.
  615.  
  616. `C-c C-q'
  617.      Fill all paragraphs of yanked old messages, each individually
  618.      (`mail-fill-yanked-message').
  619.  
  620. `M-x ispell-message'
  621.      Do spelling correction on the message text, but not on citations
  622.      from other messages.
  623.  
  624.    There are two ways to send the message.  `C-c C-s' (`mail-send')
  625. sends the message and marks the mail buffer unmodified, but leaves that
  626. buffer selected so that you can modify the message (perhaps with new
  627. recipients) and send it again.  `C-c C-c' (`mail-send-and-exit') sends
  628. and then deletes the window or switches to another buffer.  It puts the
  629. mail buffer at the lowest priority for reselection by default, since
  630. you are finished with using it.  This is the usual way to send the
  631. message.
  632.  
  633.    While editing a header field that contains mailing addresses, such as
  634. `To:', `CC:' and `BCC:', you can complete a mailing address by typing
  635. `M-TAB' (`mail-complete').  For completion purposes, the valid mailing
  636. addresses are taken to be the local users' names plus your personal
  637. mail aliases.  Additionally, if your site provides a mail directory or
  638. a specific host to use for any unrecognized user name, you can arrange
  639. to query that host for completion--see the variables
  640. `mail-directory-process' and `mail-directory-stream' in the source code.
  641.  
  642.    If you type `M-TAB' in the body of the message, it invokes
  643. `ispell-complete-word', as in Text mode.
  644.  
  645.    Mail mode provides special commands for editing the headers and text
  646. of the message before you send it.  There are five commands defined to
  647. move point to particular header fields, all based on the prefix `C-c
  648. C-f' (`C-f' is for "field").  They are `C-c C-f C-t' (`mail-to') to
  649. move to the `To' field, `C-c C-f C-s' (`mail-subject') for the
  650. `Subject' field, `C-c C-f C-c' (`mail-cc') for the `CC' field, `C-c C-f
  651. C-b' (`mail-bcc') for the `BCC' field, and `C-c C-f C-f' (`mail-fcc')
  652. for the `FCC' field.  If the field in question does not exist, these
  653. commands create one.  We provide special motion commands for these
  654. particular fields because they are the fields users most often want to
  655. edit.
  656.  
  657.    `C-c C-t' (`mail-text') moves point to just after the header
  658. separator line--that is, to the beginning of the message body text.
  659.  
  660.    `C-c C-w' (`mail-signature') adds a standard piece text at the end
  661. of the message to say more about who you are.  The text comes from the
  662. file `.signature' in your home directory.  To insert your signature
  663. automatically, set the variable `mail-signature' to `t'; then starting
  664. a mail message automatically inserts the contents of your `.signature'
  665. file.  If you want to omit your signature from a particular message,
  666. delete it from the buffer before you send the message.
  667.  
  668.    You can also set `mail-signature' to a string; then that string is
  669. inserted automatically as your signature when you start editing a
  670. message to send.
  671.  
  672.    When mail sending is invoked from the Rmail mail reader using an
  673. Rmail command, `C-c C-y' can be used inside the mail buffer to insert
  674. the text of the message you are replying to.  Normally it indents each
  675. line of that message four spaces and eliminates most header fields.  A
  676. numeric argument specifies the number of spaces to indent.  An argument
  677. of just `C-u' says not to indent at all and not to eliminate anything.
  678. `C-c C-y' always uses the current message from the Rmail buffer, so you
  679. can insert several old messages by selecting one in Rmail, switching to
  680. `*mail*' and yanking it, then switching back to Rmail to select another.
  681.  
  682.    You can specify the text for `C-c C-y' to insert at the beginning of
  683. each line: set `mail-yank-prefix' to the desired string.  (A value of
  684. `nil' means to use indentation; this is the default.) However, `C-u C-c
  685. C-y' never adds anything at the beginning of the inserted lines,
  686. regardless of the value of `mail-yank-prefix'.
  687.  
  688.    After using `C-c C-y', you can use the command `C-c C-q'
  689. (`mail-fill-yanked-message') to fill the paragraphs of the yanked old
  690. message or messages.  One use of `C-c C-q' fills all such paragraphs,
  691. each one individually.  To fill a single paragraph of the quoted
  692. message, use `M-q', after first setting the fill prefix appropriately
  693. to handle the indentation.  *Note Filling::.
  694.  
  695.    You can do spelling correction on the message text you have written
  696. with the command `M-x ispell-message'.  If you have yanked an incoming
  697. message into the outgoing draft, this command skips what was yanked,
  698. but it checks the text that you yourself inserted.  (It looks for
  699. indentation or `mail-yank-prefix' to distinguish the cited lines from
  700. your input.)  *Note Spelling::.
  701.  
  702.    Mail mode defines the character `%' as a word separator; this is
  703. helpful for using the word commands to edit mail addresses.
  704.  
  705.    Mail mode is normally used in buffers set up automatically by the
  706. `mail' command and related commands.  However, you can also switch to
  707. Mail mode in a file-visiting buffer.  That is a useful thing to do if
  708. you have saved draft message text in a file.  In a file-visiting buffer,
  709. `C-c C-c' does not clear the modified flag, because only saving the
  710. file should do that.  As a result, you don't get a warning about trying
  711. to send the same message twice.
  712.  
  713.    Turning on Mail mode (which `C-x m' does automatically) runs the
  714. normal hooks `text-mode-hook' and `mail-mode-hook'.  Initializing a new
  715. outgoing message runs the normal hook `mail-setup-hook'; if you want to
  716. add special fields to your mail header or make other changes to the
  717. appearance of the mail buffer, use that hook.  *Note Hooks::.
  718.  
  719.    The main difference between these hooks is just when they are
  720. invoked.  Whenever you type `M-x mail', `mail-mode-hook' runs as soon
  721. as the `*mail*' buffer is created.  Then the `mail-setup' function puts
  722. in the default contents of the buffer.  After these default contents
  723. are inserted, `mail-setup-hook' runs.
  724.  
  725. 
  726. File: emacs,  Node: Distracting NSA,  Prev: Mail Mode,  Up: Sending Mail
  727.  
  728. Distracting the NSA
  729. ===================
  730.  
  731.    `M-x spook' adds a line of randomly chosen keywords to an outgoing
  732. mail message.  The keywords are chosen from a list of words that suggest
  733. you are discussing something subversive.
  734.  
  735.    The idea behind this feature is the suspicion that the NSA snoops on
  736. all electronic mail messages that contain keywords suggesting they might
  737. find them interesting.  (The NSA says they don't, but that's what they
  738. *would* say.)  The idea is that if lots of people add suspicious words
  739. to their messages, the NSA will get so busy with spurious input that
  740. they will have to give up reading it all.
  741.  
  742.    Here's how to insert spook keywords automatically whenever you start
  743. entering an outgoing message:
  744.  
  745.      (add-hook 'mail-setup-hook 'spook)
  746.  
  747.    Whether or not this confuses the NSA, it at least amuses people.
  748.  
  749. 
  750. File: emacs,  Node: Rmail,  Next: Dired,  Prev: Sending Mail,  Up: Top
  751.  
  752. Reading Mail with Rmail
  753. ***********************
  754.  
  755.    Rmail is an Emacs subsystem for reading and disposing of mail that
  756. you receive.  Rmail stores mail messages in files called Rmail files.
  757. Reading the message in an Rmail file is done in a special major mode,
  758. Rmail mode, which redefines most letters to run commands for managing
  759. mail.
  760.  
  761. * Menu:
  762.  
  763. * Basic: Rmail Basics.       Basic concepts of Rmail, and simple use.
  764. * Scroll: Rmail Scrolling.   Scrolling through a message.
  765. * Motion: Rmail Motion.      Moving to another message.
  766. * Deletion: Rmail Deletion.  Deleting and expunging messages.
  767. * Inbox: Rmail Inbox.        How mail gets into the Rmail file.
  768. * Files: Rmail Files.        Using multiple Rmail files.
  769. * Output: Rmail Output.         Copying message out to files.
  770. * Labels: Rmail Labels.      Classifying messages by labeling them.
  771. * Reply: Rmail Reply.        Sending replies to messages you are viewing.
  772. * Summary: Rmail Summary.    Summaries show brief info on many messages.
  773. * Sort: Rmail Sorting.       Sorting messages in Rmail.
  774. * Display: Rmail Display.    How Rmail displays a message; customization.
  775. * Editing: Rmail Editing.    Editing message text and headers in Rmail.
  776. * Digest: Rmail Digest.      Extracting the messages from a digest message.
  777. * Out of Rmail::         Converting an Rmail file to mailbox format.
  778. * Rot13: Rmail Rot13.         Reading messages encoded in the rot13 code.
  779.  
  780. 
  781. File: emacs,  Node: Rmail Basics,  Next: Rmail Scrolling,  Up: Rmail
  782.  
  783. Basic Concepts of Rmail
  784. =======================
  785.  
  786.    Using Rmail in the simplest fashion, you have one Rmail file
  787. `~/RMAIL' in which all of your mail is saved.  It is called your
  788. "primary Rmail file".  The command `M-x rmail' reads your primary Rmail
  789. file, merges new mail in from your inboxes, displays the first message
  790. you haven't read yet, and lets you begin reading.  The variable
  791. `rmail-file-name' specifies the name of the primary Rmail file.
  792.  
  793.    Rmail uses narrowing to hide all but one message in the Rmail file.
  794. The message that is shown is called the "current message".  Rmail
  795. mode's special commands can do such things as delete the current
  796. message, copy it into another file, send a reply, or move to another
  797. message.  You can also create multiple Rmail files and use Rmail to move
  798. messages between them.
  799.  
  800.    Within the Rmail file, messages are normally arranged sequentially in
  801. order of receipt; you can specify other ways to sort them.  Messages are
  802. assigned consecutive integers as their "message numbers".  The number
  803. of the current message is displayed in Rmail's mode line, followed by
  804. the total number of messages in the file.  You can move to a message by
  805. specifying its message number with the `j' key (*note Rmail Motion::.).
  806.  
  807.    Following the usual conventions of Emacs, changes in an Rmail file
  808. become permanent only when the file is saved.  You can save it with `s'
  809. (`rmail-save'), which also expunges deleted messages from the file
  810. first (*note Rmail Deletion::.).  To save the file without expunging,
  811. use `C-x C-s'.  Rmail also saves the Rmail file after merging new mail
  812. from an inbox file (*note Rmail Inbox::.).
  813.  
  814.    You can exit Rmail with `q' (`rmail-quit'); this expunges and saves
  815. the Rmail file and then switches to another buffer.  But there is no
  816. need to `exit' formally.  If you switch from Rmail to editing in other
  817. buffers, and never happen to switch back, you have exited.  (The Rmail
  818. command `b', `rmail-bury', does this for you.)  Just make sure to save
  819. the Rmail file eventually (like any other file you have changed).  `C-x
  820. s' is a good enough way to do this (*note Saving::.).
  821.  
  822. 
  823. File: emacs,  Node: Rmail Scrolling,  Next: Rmail Motion,  Prev: Rmail Basics,  Up: Rmail
  824.  
  825. Scrolling Within a Message
  826. ==========================
  827.  
  828.    When Rmail displays a message that does not fit on the screen, you
  829. must scroll through it to read the rest.  You could do this with `C-v',
  830. `M-v' and `M-<', but in Rmail scrolling is so frequent that it deserves
  831. to be easier to type.
  832.  
  833. `SPC'
  834.      Scroll forward (`scroll-up').
  835.  
  836. `DEL'
  837.      Scroll backward (`scroll-down').
  838.  
  839. `.'
  840.      Scroll to start of message (`rmail-beginning-of-message').
  841.  
  842.    Since the most common thing to do while reading a message is to
  843. scroll through it by screenfuls, Rmail makes SPC and DEL synonyms of
  844. `C-v' (`scroll-up') and `M-v' (`scroll-down')
  845.  
  846.    The command `.' (`rmail-beginning-of-message') scrolls back to the
  847. beginning of the selected message.  This is not quite the same as `M-<':
  848. for one thing, it does not set the mark; for another, it resets the
  849. buffer boundaries to the current message if you have changed them.
  850.  
  851. 
  852. File: emacs,  Node: Rmail Motion,  Next: Rmail Deletion,  Prev: Rmail Scrolling,  Up: Rmail
  853.  
  854. Moving Among Messages
  855. =====================
  856.  
  857.    The most basic thing to do with a message is to read it.  The way to
  858. do this in Rmail is to make the message current.  The usual practice is
  859. to move sequentially through the file, since this is the order of
  860. receipt of messages.  When you enter Rmail, you are positioned at the
  861. first message that you have not yet made current (that is, the first one
  862. that has the `unseen' attribute; *note Rmail Labels::.).  Move forward
  863. to see the other new messages; move backward to reexamine old messages.
  864.  
  865. `n'
  866.      Move to the next nondeleted message, skipping any intervening
  867.      deleted messages (`rmail-next-undeleted-message').
  868.  
  869. `p'
  870.      Move to the previous nondeleted message
  871.      (`rmail-previous-undeleted-message').
  872.  
  873. `M-n'
  874.      Move to the next message, including deleted messages
  875.      (`rmail-next-message').
  876.  
  877. `M-p'
  878.      Move to the previous message, including deleted messages
  879.      (`rmail-previous-message').
  880.  
  881. `j'
  882.      Move to the first message.  With argument N, move to message
  883.      number N (`rmail-show-message').
  884.  
  885. `>'
  886.      Move to the last message (`rmail-last-message').
  887.  
  888. `<'
  889.      Move to the first message (`rmail-first-message').
  890.  
  891. `M-s REGEXP RET'
  892.      Move to the next message containing a match for REGEXP
  893.      (`rmail-search').
  894.  
  895. `- M-s REGEXP RET'
  896.      Move to the previous message containing a match for REGEXP.
  897.  
  898.    `n' and `p' are the usual way of moving among messages in Rmail.
  899. They move through the messages sequentially, but skip over deleted
  900. messages, which is usually what you want to do.  Their command
  901. definitions are named `rmail-next-undeleted-message' and
  902. `rmail-previous-undeleted-message'.  If you do not want to skip deleted
  903. messages--for example, if you want to move to a message to undelete
  904. it--use the variants `M-n' and `M-p' (`rmail-next-message' and
  905. `rmail-previous-message').  A numeric argument to any of these commands
  906. serves as a repeat count.
  907.  
  908.    In Rmail, you can specify a numeric argument by typing just the
  909. digits.  You don't need to type `C-u' first.
  910.  
  911.    The `M-s' (`rmail-search') command is Rmail's version of search.
  912. The usual incremental search command `C-s' works in Rmail, but it
  913. searches only within the current message.  The purpose of `M-s' is to
  914. search for another message.  It reads a regular expression (*note
  915. Regexps::.) nonincrementally, then searches starting at the beginning
  916. of the following message for a match.  It then selects that message.
  917. If REGEXP is empty, `M-s' reuses the regexp used the previous time.
  918.  
  919.    To search backward in the file for another message, give `M-s' a
  920. negative argument.  In Rmail you can do this with `- M-s'.
  921.  
  922.    It is also possible to search for a message based on labels.  *Note
  923. Rmail Labels::.
  924.  
  925.    To move to a message specified by absolute message number, use `j'
  926. (`rmail-show-message') with the message number as argument.  With no
  927. argument, `j' selects the first message.  `<' (`rmail-first-message')
  928. also selects the first message.  `>' (`rmail-last-message') selects the
  929. last message.
  930.  
  931. 
  932. File: emacs,  Node: Rmail Deletion,  Next: Rmail Inbox,  Prev: Rmail Motion,  Up: Rmail
  933.  
  934. Deleting Messages
  935. =================
  936.  
  937.    When you no longer need to keep a message, you can "delete" it.  This
  938. flags it as ignorable, and some Rmail commands pretend it is no longer
  939. present; but it still has its place in the Rmail file, and still has its
  940. message number.
  941.  
  942.    "Expunging" the Rmail file actually removes the deleted messages.
  943. The remaining messages are renumbered consecutively.  Expunging is the
  944. only action that changes the message number of any message, except for
  945. undigestifying (*note Rmail Digest::.).
  946.  
  947. `d'
  948.      Delete the current message, and move to the next nondeleted message
  949.      (`rmail-delete-forward').
  950.  
  951. `C-d'
  952.      Delete the current message, and move to the previous nondeleted
  953.      message (`rmail-delete-backward').
  954.  
  955. `u'
  956.      Undelete the current message, or move back to a deleted message and
  957.      undelete it (`rmail-undelete-previous-message').
  958.  
  959. `x'
  960.      Expunge the Rmail file (`rmail-expunge').
  961.  
  962.    There are two Rmail commands for deleting messages.  Both delete the
  963. current message and select another message.  `d'
  964. (`rmail-delete-forward') moves to the following message, skipping
  965. messages already deleted, while `C-d' (`rmail-delete-backward') moves
  966. to the previous nondeleted message.  If there is no nondeleted message
  967. to move to in the specified direction, the message that was just
  968. deleted remains current.
  969.  
  970.    Whenever Rmail deletes a message, it invokes the function(s) listed
  971. in `rmail-delete-message-hook'.  When the hook functions are invoked,
  972. the message has been marked deleted, but it is still the current message
  973. in the Rmail buffer.
  974.  
  975.    To make all the deleted messages finally vanish from the Rmail file,
  976. type `x' (`rmail-expunge').  Until you do this, you can still
  977. "undelete" the deleted messages.  The undeletion command, `u'
  978. (`rmail-undelete-previous-message'), is designed to cancel the effect
  979. of a `d' command in most cases.  It undeletes the current message if
  980. the current message is deleted.  Otherwise it moves backward to
  981. previous messages until a deleted message is found, and undeletes that
  982. message.
  983.  
  984.    You can usually undo a `d' with a `u' because the `u' moves back to
  985. and undeletes the message that the `d' deleted.  But this does not work
  986. when the `d' skips a few already-deleted messages that follow the
  987. message being deleted; then the `u' command undeletes the last of the
  988. messages that were skipped.  There is no clean way to avoid this
  989. problem.  However, by repeating the `u' command, you can eventually get
  990. back to the message that you intend to undelete.  You can also select a
  991. particular deleted message with the `M-p' command, then type `u' to
  992. undelete it.
  993.  
  994.    A deleted message has the `deleted' attribute, and as a result
  995. `deleted' appears in the mode line when the current message is deleted.
  996. In fact, deleting or undeleting a message is nothing more than adding
  997. or removing this attribute.  *Note Rmail Labels::.
  998.  
  999. 
  1000. File: emacs,  Node: Rmail Inbox,  Next: Rmail Files,  Prev: Rmail Deletion,  Up: Rmail
  1001.  
  1002. Rmail Files and Inboxes
  1003. =======================
  1004.  
  1005.    The operating system places incoming mail for you in a file that we
  1006. call your "inbox".  When you start up Rmail, it runs a C program called
  1007. `movemail' to copy the new messages from your inbox into your primary
  1008. Rmail file, which also contains other messages saved from previous
  1009. Rmail sessions.  It is in this file that you actually read the mail
  1010. with Rmail.  This operation is called "getting new mail".  You can get
  1011. new mail at any time in Rmail by typing `g'.
  1012.  
  1013.    The variable `rmail-primary-inbox-list' contains a list of the files
  1014. which are inboxes for your primary Rmail file.  If you don't set this
  1015. variable explicitly, it is initialized from the `MAIL' environment
  1016. variable, or, as a last resort, set to `nil', which means to use the
  1017. default inbox.  The default inbox is `/var/mail/USERNAME',
  1018. `/usr/spool/mail/USERNAME', or `/usr/mail/USERNAME', depending on your
  1019. operating system.  You can specify the inbox file(s) for any Rmail file
  1020. with the command `set-rmail-inbox-list'; see *Note Rmail Files::.
  1021.  
  1022.    Some sites use a method called POP for accessing users' inbox data
  1023. instead of storing the data in inbox files.  `movemail' can work with
  1024. POP if you compile it with the macro `MAIL_USE_POP' defined, and then
  1025. install it setuid to `root'.  It is safe to install `movemail' in this
  1026. way.  Note: `movemail' only works with POP3, not with older versions of
  1027. POP.
  1028.  
  1029.    Assuming you have compiled and installed `movemail' appropriately,
  1030. you can specify a POP inbox with a "file name" of the form
  1031. `po:USERNAME'.  `movemail' handles such a name by opening a connection
  1032. to the POP server.  The `MAILHOST' environment variable specifies the
  1033. machine to look for the server on.
  1034.  
  1035.    Accessing mail via POP may require a password.  If the variable
  1036. `rmail-pop-password' is non-`nil', it specifies the password to use for
  1037. POP.  Alternatively, if `rmail-pop-password-required' is non-`nil',
  1038. then Rmail asks you for the password to use.
  1039.  
  1040.    There are two reasons for having separate Rmail files and inboxes.
  1041.  
  1042.   1. The inbox file format varies between operating systems and
  1043.      according to the other mail software in use.  Only one part of
  1044.      Rmail needs to know about the alternatives, and it need only
  1045.      understand how to convert all of them to Rmail's own format.
  1046.  
  1047.   2. It is very cumbersome to access an inbox file without danger of
  1048.      losing mail, because it is necessary to interlock with mail
  1049.      delivery.  Moreover, different operating systems use different
  1050.      interlocking techniques.  The strategy of moving mail out of the
  1051.      inbox once and for all into a separate Rmail file avoids the need
  1052.      for interlocking in all the rest of Rmail, since only Rmail
  1053.      operates on the Rmail file.
  1054.  
  1055.    Rmail was written to use Babyl format as its internal format.  Since
  1056. then, we have recognized that the usual inbox format on Unix and GNU
  1057. systems is adequate for the job, and we plan to change Rmail to use that
  1058. as its internal format.  However, the Rmail file will still be separate
  1059. from the inbox file, even on systems where their format is the same.
  1060.  
  1061.    When getting new mail, Rmail first copies the new mail from the inbox
  1062. file to the Rmail file; then it saves the Rmail file; then it truncates
  1063. the inbox file.  This way, a system crash may cause duplication of mail
  1064. between the inbox and the Rmail file, but cannot lose mail.
  1065.  
  1066.    When `movemail' copies mail from an inbox in the system's mailer
  1067. directory, it actually puts it in an intermediate file
  1068. `~/.newmail-INBOXNAME'.  Once it finishes, Rmail reads that file,
  1069. merges the new mail, saves the Rmail file, and only then deletes the
  1070. intermediate file.  If there is a crash at the wrong time, this file
  1071. continues to exist and Rmail will use it again the next time it gets new
  1072. mail from that inbox.
  1073.  
  1074. 
  1075. File: emacs,  Node: Rmail Files,  Next: Rmail Output,  Prev: Rmail Inbox,  Up: Rmail
  1076.  
  1077. Multiple Rmail Files
  1078. ====================
  1079.  
  1080.    Rmail operates by default on your "primary Rmail file", which is
  1081. named `~/RMAIL' and receives your incoming mail from your system inbox
  1082. file.  But you can also have other Rmail files and edit them with
  1083. Rmail.  These files can receive mail through their own inboxes, or you
  1084. can move messages into them with explicit Rmail commands (*note Rmail
  1085. Output::.).
  1086.  
  1087. `i FILE RET'
  1088.      Read FILE into Emacs and run Rmail on it (`rmail-input').
  1089.  
  1090. `M-x set-rmail-inbox-list RET FILES RET'
  1091.      Specify inbox file names for current Rmail file to get mail from.
  1092.  
  1093. `g'
  1094.      Merge new mail from current Rmail file's inboxes
  1095.      (`rmail-get-new-mail').
  1096.  
  1097. `C-u g FILE RET'
  1098.      Merge new mail from inbox file FILE.
  1099.  
  1100.    To run Rmail on a file other than your primary Rmail file, you may
  1101. use the `i' (`rmail-input') command in Rmail.  This visits the file in
  1102. Rmail mode.  You can use `M-x rmail-input' even when not in Rmail.
  1103.  
  1104.    The file you read with `i' should normally be a valid Rmail file.
  1105. If it is not, Rmail tries to decompose it into a stream of messages in
  1106. various known formats.  If it succeeds, it converts the whole file to an
  1107. Rmail file.  If you specify a file name that doesn't exist, `i'
  1108. initializes a new buffer for creating a new Rmail file.
  1109.  
  1110.    You can also select an Rmail file from a menu.  Choose first the menu
  1111. bar Classify item, then from the Classify menu choose the Input Rmail
  1112. File item; then choose the Rmail file you want.  The variables
  1113. `rmail-secondary-file-directory' and `rmail-secondary-file-regexp'
  1114. specify which files to offer in the menu: the first variable says which
  1115. directory to find them in; the second says which files in that
  1116. directory to offer (all those that match the regular expression).
  1117. These variables also apply to choosing a file for output (*note Rmail
  1118. Output::.).
  1119.  
  1120.    Each Rmail file can contain a list of inbox file names; you can
  1121. specify this list with `M-x set-rmail-inbox-list RET FILES RET'.  The
  1122. argument can contain any number of file names, separated by commas.  It
  1123. can also be empty, which specifies that this file should have no
  1124. inboxes.  Once a list of inboxes is specified, the Rmail file remembers
  1125. it permanently until you specify a different list.
  1126.  
  1127.    As a special exception, if your primary Rmail file does not specify
  1128. any inbox files, it uses your standard system inbox.
  1129.  
  1130.    The `g' command (`rmail-get-new-mail') merges mail into the current
  1131. Rmail file from its specified inboxes.  If the Rmail file has no
  1132. inboxes, `g' does nothing.  The command `M-x rmail' also merges new
  1133. mail into your primary Rmail file.
  1134.  
  1135.    To merge mail from a file that is not the usual inbox, give the `g'
  1136. key a numeric argument, as in `C-u g'.  Then it reads a file name and
  1137. merges mail from that file.  The inbox file is not deleted or changed
  1138. in any way when `g' with an argument is used.  This is, therefore, a
  1139. general way of merging one file of messages into another.
  1140.  
  1141.